<template>
  <free-app bgType="image" :showNavbar="true" :navbar="navbarOptions">
    <view class="p-3 flex flex-col gap-3">
      <!-- serach -->
      <SearchBox
        :showScan="false"
        placeholder="按门店名称或者地址搜索"
      ></SearchBox>
      <view class="flex flex-col gap-3">
        <view
          class="bg-white flex rounded-[24rpx] gap-[20rpx] p-3"
          @click="chooseStore"
        >
          <image
            src="/static/images/logo.png"
            class="size-[152rpx] rounded-[20rpx]"
            mode="scaleToFill"
          />
          <view class="flex justify-between flex-col flex-1">
            <view class="">
              <view class="flex justify-between items-center">
                <view class="font-500 text-size-3 pb-1 text-ellipsis"
                  >永丰手机维修（a店）</view
                >
                <view class="text-[20rpx] font-400"> 1134.lkm </view>
              </view>
              <view class="text-size-1 font-400 color-text-3"
                >江苏省苏州市吴江区黎里镇绵绣园锦绣园</view
              >
            </view>
            <view
              class="flex gap-1 items-center text-size-1 font-400 color-text-2"
            >
              <image
                src="/static/images/icon/clock.png"
                class="size-[24rpx]"
                mode="scaleToFill"
              /><text>营业时间：</text><text>08:30-21:00</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </free-app>
</template>

<script setup>
import { ref } from "vue";
import SearchBox from "@/components/search-box/index.vue";
// import { mutations } from "@/store/city.js";
// import useUserStore from "@/store/user.js";
import { onUnload } from "@dcloudio/uni-app";
// const userStore = useUserStore();
const navbarOptions = {
  title: "选择小店",
  placeholder: true,
};
const chooseStore = async (city) => {
  // mutations.setCityInfo(city);
  // 返回上一页
  // this.$Router.back(1, {
  // 	success: () => {
  // 		const {
  // 			onLoad,
  // 			options
  // 		} = currentPage()
  // 		// 刷新上一个页面
  // 		onLoad && onLoad({ ...options, refresh: true })
  // 	}
  // })

  uni.navigateBack({
    delta: 1,
  });

  // userStore.setUserInfo({
  //   field: "lng",
  //   value: city.lng,
  // });
  // userStore.setUserInfo({
  //   field: "lat",
  //   value: city.lat,
  // });
};
onUnload(() => {
  uni.$emit("refreshhome");
});
</script>

<style lang="scss" scoped></style>
